package cn.com.guage.dtm.huawei;

import java.util.Scanner;

public class HJ6_质数因子 {
    public static void main(String[] args) {
        method1();
    }

    /**
     * 1. 通过试除法，从最小的质数开始依次尝试整除 num，直到将 num 分解为 1 或剩余一个质数。
     * 2. 计算 num 的平方根 long k = (long) Math.sqrt(num);
     */
    private static void  method1(){
        Scanner scanner = new Scanner(System.in);
        long num = scanner.nextLong();
        long k = (long) Math.sqrt(num);

        for (long i = 2; i <= k; ++i) {
            while (num % i == 0) {
                System.out.print(i + " ");
                num /= i;

            }
        }
        System.out.println(num == 1 ? "" : num + " ");
    }
}
